<?php

/**
 * 获取软件的审核状态
 * @param  [type]
 * @return [type]
 */
function my_get_projects_status($status){
	$status = intval($status);
	switch ($status) {
		case 0:
			return '待审核';
			break;

		case 1:
			return '通过';
			break;

		case 25:
			return '已拒绝';
			break;

		default:
			return '待审核';
			break;
	}
}

/**
 * 获取投递新闻的审核状态
 * @param  [type]
 * @return [type]
 */
function my_get_news_status($status){
	$status = intval($status);
	switch ($status) {
		case 0:
			return '待审核';
			break;

		case 1:
			return '通过';
			break;

		case 25:
			return '已拒绝';
			break;

		default:
			return '待审核';
			break;
	}
}

/**
 * 根据用户id取出所有博客分类，用于选择栏目
 * @param  [type] $user_id [description]
 * @return [type]          [description]
 */
function get_user_category($user_id){
	$user_category = BlogUserCategory::where('user_id',$user_id)->select('name','id')->get();
	$category = array();
	foreach ($user_category as $key => $value) {
		$category[$value['id']] = $value['name'];
	}

	return $category;
}
?>